<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['prefix'=>''],function (){
    Route::post('cms_login','cms\Admin@login');//用户获取小程序token
    Route::get('check_token','common\Common@check_token');//验证token是否过期

});
//cms管理员
Route::group(['prefix'=>'cms'],function (){
    //首页数据
    Route::group(['prefix'=>'home'],function (){
        Route::get('get_data','cms\Home@statistics');//获取首页数据
    });
    //图片分类管理
    Route::group(['prefix'=>'image_category'],function (){
        Route::post('insert','cms\ImageCategory@insert');//添加图片分类
        Route::post('update','cms\ImageCategory@update');//更新图片分类
        Route::get('get','cms\ImageCategory@get');//获取图片分类
        Route::put('del','cms\ImageCategory@del');//删除图片分类
    });

    //图片管理
    Route::group(['prefix'=>'image'],function (){
        Route::post('insert','cms\Image@insert');//添加图片
        Route::post('edit_img','cms\Image@edit_img');//富文本图片上传
        Route::get('get','cms\Image@get');//获取图片
        Route::put('del','cms\Image@del');//删除图片
    });

    //配置管理
    Route::group(['prefix'=>'sys'],function (){
        Route::post('insert','cms\Sys@insert');//添加配置信息
        Route::get('get','cms\Sys@get');//获取配置信息
        Route::post('update','cms\Sys@update');//更新配置信息
    });

    //广告管理
    Route::group(['prefix'=>'banner'],function (){
        Route::get('get','cms\Banner@get');//获取广告
        Route::post('insert','cms\Banner@insert');//插入广告
        Route::post('update','cms\Banner@update');//更新广告
        Route::put('del','cms\Banner@del');//删除广告信息
    });

    //项目管理
    Route::group(['prefix'=>'house'],function (){
        Route::get('get_type','cms\HouseType@get');//获取房屋类型
        Route::post('add_type','cms\HouseType@insert');//添加房屋类型
        Route::post('update_type','cms\HouseType@update');//更新房屋类型
        Route::put('del_type','cms\HouseType@del');//删除房屋类型
        Route::get('get_project','cms\Project@get');//获取楼栋表
        Route::post('add_project','cms\Project@insert');//添加楼栋表
        Route::post('update_project','cms\Project@update');//更新
        Route::put('del_project','cms\Project@del');//删除楼栋表

        Route::get('get_house','cms\House@get');//获取房屋信息
        Route::post('add_house','cms\House@insert');//添加房屋信息
        Route::post('update_house','cms\House@update');//更新房屋信息
        Route::put('del_house','cms\House@del');//删除房屋信息

        Route::post('regeo','cms\House@regeo');//坐标转换
    });

    //文章管理
    Route::group(['prefix'=>'article'],function (){
        Route::get('get','cms\Article@get');//获取文章
        Route::post('insert','cms\Article@insert');//添加文章
        Route::post('update','cms\Article@update');//更新文章
        Route::put('del','cms\Article@del');//删除文章
    });

    //首页数据
    Route::group(['prefix'=>'yuyue'],function (){
        Route::get('get','cms\Yuyue@get');//获取预约数据
        Route::post('update','cms\Yuyue@update');//更新预约数据
    });

    //用户
    Route::group(['prefix'=>'user'],function (){
        Route::get('get','cms\user@get');//获取用户信息
        Route::get('get_tx','cms\TxRecourd@get_tx');//获取提现记录
        Route::get('get_invite','cms\TxRecourd@get_invite');//获取邀请记录
    });
});

Route::group(['prefix'=>'user'],function (){
    Route::group(['prefix'=>'common'],function (){
        Route::get('get_banner','user\Common@banner');//获取广告图
        Route::get('get_house','user\Common@house');//获取house
        Route::get('get_sys','user\Common@sys');//获取配置
        Route::get('get_house_type','user\Common@house_type');//获取房屋类型
        Route::get('get_house_id','user\Common@house_id');//id获取房屋
    });
    
    
      //收藏
    Route::group(['prefix'=>'collection'],function (){
        Route::get('insert','user\Collection@insert');//用户添加收藏
        Route::get('get','user\Collection@get');//获取收藏
    });



    //预约
    Route::group(['prefix'=>'yuyue'],function (){
        Route::post('insert','user\Yuyue@insert');//添加预约
        Route::get('get','user\Yuyue@get');//获取预约记录
        Route::get('cancel','user\Yuyue@cancel');//取消预约
    });
    
     //登录
    Route::group(['prefix'=>''],function (){
        Route::post('get_xcx_token','user\User@xcx_login');//获取小程序token
        Route::get('infor','user\User@infor');//获取个人信息
        Route::post('update_infor','user\User@update_infor');//更新个人信息
        Route::get('create_house_qrcode','user\User@create_house_qrcode');//获取邀请码
        Route::get('get_invite_user','user\User@get_invite_user');//获取邀请用户
        Route::post('tx','user\User@tx');//用户提现
        Route::get('get_fx_log','user\User@get_fx_log');//获取分销日志
        Route::get('bind_user','user\User@bind_user');//绑定新用户
         Route::post('bind_mobile','user\User@bind_mobile');//用户绑定手机号码
    });
});



